import Request from "../../common/request";

export function register(data:Auth.RegisterReq) {
    return Request.post<Auth.RegisterResp>("/api/auth/register", data);
}

export function login(data:Auth.LoginReq) {
    return Request.post<Auth.LoginResp|Auth.RegisterError>("/api/auth/login", data);
}

export function logout(){
    return Request.post<Auth.RegisterResp>('/api/auth/logout');
}

export function getUser() {
    return Request.get<Auth.UserResp>("/api/user");
}
